package com.khh.mapper;

import com.khh.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Integer uid);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer uid);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);



    @Insert("insert into user values(null,#{uname},#{uage})")
    int insertByUser(User record);

    //延时加载
    public User queryByIdLazy(int id);

    //手动添加  配置二级缓存
    public List<User> queryAll();

    //注解二级缓存
    @Select("select * from user")
    public List<User> queryAllByZhu();

}